function CommentList(props) {
    var commentNodes = props.data.map(function (comment) {
        return (
            <div className="comment">
                <h2 className="commentAuthor">
                    {comment.author}
                </h2>
                {comment.text}
            </div>
        );
    });
    return (
        <div className="commentList">
            {commentNodes}
        </div>
    );
}

$(function(){
    $.ajax({
        type: "GET",
        url: "http://localhost:9090/demo-web/home/getCommentList",
        dataType: "json",
        success: function (commentList) {
            ReactDOM.render(
                <CommentList data={commentList}/>,
                document.getElementById('list')
            );
        }
    });
});
